package com.dingding.transfer.stamper.constant;

import com.dingding.transfer.stamper.dto.*;

/**
 * @author wangxiyuan
 * @description
 * @createDate 2021/4/2 9:42
 **/
public enum StamperEnum {
    CMD_DEVICE_REG ( 1000, DeviceInfoRes.class),

    /***指纹录入 协议号*/
    CMD_FINGER_ADD ( 1010, FingerAddRes.class),

    /***指纹删除 协议号*/
    CMD_FINGER_DEL ( 1011, FingerDelRes.class),

    /***指纹清空 协议号*/
    CMD_FINGER_CLEAR ( 1012, FingerClearRes.class),

    /***Wifi列表 协议号*/
    CMD_WIFILIST ( 1020, WifiListRes.class ),

    /***推送申请单 协议号*/
    CMD_APPLICATION_PUSH ( 1040,ApplicationPushRes.class),

    /***结束申请单 协议号*/
    CMD_APPLICATION_CLOSE ( 1041,ApplicationCloseRes.class),

    /***设置休眠 协议号*/
    CMD_SLEEP_SET ( 1050,SleepInfoRes.class),

    /***切换模式 协议号*/
    CMD_MODEL ( 1060,ModelInfoRes.class),

    /***无指纹用章 协议号*/
    CMD_LOCK_ID ( 1070,IdLockInfoRes.class),

    /***初始化设备 协议号*/
    CMD_INIT ( 1080,InitInfoRes.class),

    /***锁定 协议号*/
    CMD_LOCK ( 1090,LockInfoRes.class),

    /***上传记录 协议号*/
    CMD_INFO ( 1100,SealRecordInfoReq.class),

    /***绑定记录与图片 协议号*/
    CMD_BIND_INFO_AND_FILE ( 1130,InfoImageReq.class),

    /***同步设备离线申请单 协议号*/
    CMD_SYNCH_OFFLINE_APPLICATION_INFOS ( 1131,ExistApplicationRes.class),

    /***设备信息查询 */
    CMD_DEVICE_INFO ( 2000,DeviceInfoRes.class);

    private int code;

    private Class type;

    StamperEnum(int code,Class type){
        this.code = code;
        this.type = type;
    }

    public int getCode() {
        return code;
    }

    public Class getType() {
        return type;
    }

     public static Class getType(int code){
         for (StamperEnum stamperEnum :
                 StamperEnum.values()) {
                if(stamperEnum.getCode() == code){
                    return stamperEnum.getType();
                }
         }
         return null;
     }
}
